"""
    使用ffmpeg框架对文件进行转码
"""

import ffmpeg

def transform(path,file_type):
    stream = ffmpeg.input(path)
    index = path.find('.')
    new_file = path.replace(path[index+1:], type)
    stream = ffmpeg.output(path, new_file)
    ffmpeg.run(stream)

if __name__ == '__main__':
    path = 'D:\\tempVideo\\【官方MV】薛之谦 - 变废为宝.flv'
    file_type = 'mp4'
    stream = ffmpeg.input(path)
    index = path.find('.')
    new_file = path.replace(path[index + 1:], file_type)
    stream = ffmpeg.output(path, new_file)
    ffmpeg.run(stream)
